package ar.com.fracervellera.web.validator;

import java.util.List;

import ar.com.fracervellera.web.command.ProjectForm;

public class ProjectValidatorImp implements ProjectValidator {
	static ProjectValidator instance = null;
	
	private ProjectValidatorImp(){
		super();
	}
	
	public static ProjectValidator getInstance(){
		if(instance == null){
			instance = new ProjectValidatorImp();
		}
		return instance;
	}
	
	@Override
	public boolean isValid(ProjectForm form, List<String> errors) {
		if(form.getTitle().isEmpty()){
			return false;
		}
		if(form.getDescription().isEmpty()){
			return false;
		}
		if(form.getBlobKey() == null){
			return false;
		}
		return true;
	}

}
